<% add_decidim_page_title(t(".title")) %>
<div class="card">
  <div class="item_show__header item_show__header--with-action-options">
    <h1 class="item_show__header-title">
      <div>
        <%= link_to decidim_escape_translated(budget.title), budgets_path %> &gt;
        <%= t(".title") %>
        <span id="js-selected-resources-count" class="component-counter" title="<%= t("decidim.budgets.admin.projects.index.selected") %>"></span>
      </div>
      <%= render partial: "bulk-actions" %>
    </h1>

    <%= render partial: "decidim/budgets/admin/projects/bulk_actions/taxonomy_change" %>
  </div>
  <%= admin_filter_selector(:projects) %>
  <div class="table-stacked">
    <table class="table-list">
      <%= render partial: "projects-thead" %>
      <tbody>
        <%= render partial: "decidim/budgets/admin/projects/project-tr",
                   collection: projects,
                   as: :project,
                   locals: { view: :index } %>
      </tbody>
    </table>
    <% if allowed_to? :manage_trash, :project, participatory_space: current_participatory_space %>
      <div class="card mt-4">
        <%= link_to manage_trash_budget_projects_path(budget), class: "flex items-center  text-secondary" do %>
          <%= icon "delete-bin-2-line", class: "mr-2 fill-current text-secondary", role: "img" %>
          <%= t("actions.view_deleted_projects", scope: "decidim.budgets") %>
          <span class="ml-2">
          <%= icon_with_tooltip("information-line", t("actions.deleted_budgets_info", scope: "decidim.budgets")) %>
        </span>
        <% end %>
      </div>
    <% end %>
    <%= decidim_paginate projects %>
  </div>
  <div class="card-divider">
    <strong><%= t ".finished_orders" %>:&nbsp;</strong><span><%= finished_orders.count %></span>
    <span>&nbsp;|&nbsp;</span>
    <strong><%= t ".pending_orders" %>:&nbsp;</strong><span><%= pending_orders.count %></span>
  </div>
</div>

<%= append_javascript_pack_tag "decidim_budgets_admin" %>
